package com.service.impl;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.controller.common.AddressParam;
import com.controller.reqdto.AddAddressParam;
import com.controller.reqdto.AddressQueryParam;
import com.controller.reqdto.AddressUpdateParam;
import com.controller.respdto.AddressList;
import com.repository.mapper.AddressMapper;
import com.repository.mapper.PcMessageMapper;
import com.repository.mapper.SocketMsgMapper;
import com.repository.po.Address;
import com.repository.po.PcMessage;
import com.repository.po.SocketMsg;
import com.service.AddressService;
import com.service.SocketService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author Ruiwen
 * @since 2024-11-19
 */
@Service
public class SocketServiceImpl implements SocketService {

    @Resource
    private SocketMsgMapper socketMsgMapper;


    @Override
    public void addSession(String pcUniqueId) {
        SocketMsg socketMsg = SocketMsg.builder()
                .socketUnique(pcUniqueId).build();

        socketMsgMapper.insert(socketMsg);
    }

    @Override
    public void removeSession(String pcUniqueId) {
        socketMsgMapper.delete(new QueryWrapper<SocketMsg>().eq("socket_unique", pcUniqueId));
    }
}